// 1. react原版
// import { createStore, applyMiddleware } from 'redux'
// import thunk from 'redux-thunk'
// import promise from 'redux-promise'

// 2. 处理异步action
// import { createStore } from '../../8_source/2_redux_async'

// 3. 使用中间件处理异步action
import { createStore, applyMiddleware, thunkMiddleware, promiseMiddleware, loggerMiddleware } from '../../8_source/3_redux_middleware'

// 引入为counter组件服务的reducer
import { setting_reducer } from './reducers'

// 要把异步actionCreator从ui组件中抽出去到action中，就得需要异步中间件applyMiddleware(thunk)
// export default createStore(setting_reducer)
// export default createStore(setting_reducer, applyMiddleware(thunkMiddleware, promiseMiddleware))

export default createStore(setting_reducer, applyMiddleware(loggerMiddleware, thunkMiddleware, promiseMiddleware,))
